<?php
namespace Plugin\File\Schema;

use Plugin\File\Model\RdFileVoice;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 音频
 */
#[Schema(title: 'RdFileVoiceSchema')]
class RdFileVoiceSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'file', title: '音频地址', type: 'varchar')]
    public string $file;

    #[Property(property: 'text', title: '语音文字', type: 'text')]
    public string $text;

    #[Property(property: 'type', title: '音频类型 1-摄像头名称，2-预警事件，3-遵守文本', type: 'tinyint')]
    public string $type;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;




    public function __construct(RdFileVoice $model)
    {
       $this->id = $model->id;
       $this->file = $model->file;
       $this->text = $model->text;
       $this->type = $model->type;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'file' => $this->file ,'text' => $this->text ,'type' => $this->type ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at];
    }
}